<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>列表</title>
    <link rel="stylesheet" href="__STATIC__/admin/js/layer/theme/default/layer.css">
    <link rel="stylesheet" href="__STATIC__/admin/js/layui/css/layui.css">
    <link rel="stylesheet" href="__STATIC__/admin/js/bootstrap/css/bootstrap.css">
    <link href="__STATIC__/admin/css/AdminLTE.css" rel="stylesheet"
          type="text/css" />
    <!--[if lt IE 9]>
    <script src="__STATIC__/admin/js/html5shiv.min.js"></script>
    <script src="__STATIC__/admin/js/respond.min.js"></script>
    <![endif]-->
    <script src="__STATIC__/admin/js/jquery.min.js"></script>
    <script src="__STATIC__/admin/js/bootstrap/js/bootstrap.min.js"></script>
    <script src="__STATIC__/admin/js/common.js"></script>
    <script src="__STATIC__/admin/js/plugins.js"></script>
    <script src="__STATIC__/admin/js/layer/layer.js"></script>
</head>
<body>
<p><a href="{:url('admin/staff/staffAdd')}"><button class="button_2 layui-btn layui-btn-normal">添加管理</button></a></p>
<table class="table table-hover">
    <tr>
        <th>会员昵称</th>
        <th>会员头像</th>
        <th>操作</th>
    </tr>
    {volist name="row" id="vo"}
    <tr>
        <td>{$vo.staff_name}</td>
        <td><img src="{$vo.staff_photo}" width="50px" height="50px"></td>
        <td><button class="button_1 layui-btn layui-btn-danger" data-id="{$vo.staff_id}"><i class="layui-icon"></i>删除</button>
        </td>
    </tr>
    {/volist}
</table>
</body>
<script>
    $(document).ready(function(){
        $(".button_1").click(function () {
            var link = $(this);
            var fid = link.attr("data-id");
            var msg ='您确定要进行操作吗?';
            Plugins.confirm({title:'信息提示',content:msg,okText:'确定',cancelText:'取消',okFun:function(){
                Plugins.closeWindow();
                $.get("{:url('admin/staff/deLstaff')}?id="+fid,function(data){
                    if(data == 1){
                        layer.msg('删除成功');
                        setTimeout(function(){window.location.reload();},2000);
                    }else{
                        layer.msg('删除失败');
                        setTimeout(function(){window.location.reload();},2000);
                    }
                });
            }});
        })
    })
</script>
</html>